home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / PInterfaces / ControlStrip.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  8.4 KB  |  216 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        ControlStrip.p
  3.  
  4.      Contains:    Control Strip (for Powerbooks and Duos) Interfaces.
  5.  
  6.      Version:    Technology:    ControlStrip 1.4
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1992-1998 by Apple Computer, Inc. All rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT ControlStrip;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __CONTROLSTRIP__}
  27. {$SETC __CONTROLSTRIP__ := 1}
  28.  
  29. {$I+}
  30. {$SETC ControlStripIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __MACTYPES__}
  34. {$I MacTypes.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED __MENUS__}
  37. {$I Menus.p}
  38. {$ENDC}
  39. {$IFC UNDEFINED __DIALOGS__}
  40. {$I Dialogs.p}
  41. {$ENDC}
  42.  
  43.  
  44. {$PUSH}
  45. {$ALIGN MAC68K}
  46. {$LibExport+}
  47.  
  48. {********************************************************************************************
  49.  
  50.     messages passed to the modules
  51.  
  52. ********************************************************************************************}
  53.  
  54. CONST
  55.     sdevInitModule                = 0;                            {  initialize the module }
  56.     sdevCloseModule                = 1;                            {  clean up before being closed }
  57.     sdevFeatures                = 2;                            {  return feature bits }
  58.     sdevGetDisplayWidth            = 3;                            {  returns the width of the module's display }
  59.     sdevPeriodicTickle            = 4;                            {  periodic tickle when nothing else is happening }
  60.     sdevDrawStatus                = 5;                            {  update the interface in the Control Strip }
  61.     sdevMouseClick                = 6;                            {  user clicked on the module's display area in the Control Strip }
  62.     sdevSaveSettings            = 7;                            {  saved any changed settings in module's preferences file }
  63.     sdevShowBalloonHelp            = 8;                            {  puts up a help balloon, if the module has one to display }
  64.  
  65. {********************************************************************************************
  66.  
  67.     Features supported by the module.  If a bit is set, it means that feature is supported.
  68.     All undefined bits are reserved for future use by Apple, and should be set to zero.
  69.  
  70. ********************************************************************************************}
  71.     sdevWantMouseClicks            = 0;                            {  notify the module of mouseDown events }
  72.     sdevDontAutoTrack            = 1;                            {  call the module to do mouse tracking }
  73.     sdevHasCustomHelp            = 2;                            {  module provides its own help messages }
  74.     sdevKeepModuleLocked        = 3;                            {  module needs to be locked in the heap }
  75.  
  76. {********************************************************************************************
  77.  
  78.     Result values returned by the sdevPeriodicTickle and sdevIconMouseClick selectors.
  79.     If a bit is set, the module can request that a specific function is performed by
  80.     the Control Strip.  A result of zero will do nothing.  All undefined bits are reserved
  81.     for future use by Apple, and should be set to zero.
  82.  
  83. ********************************************************************************************}
  84.     sdevResizeDisplay            = 0;                            {  resize the module's display }
  85.     sdevNeedToSave                = 1;                            {  need to save changed settings, when convenient }
  86.     sdevHelpStateChange            = 2;                            {  need to update the help message because of a state change }
  87.     sdevCloseNow                = 3;                            {  close a module because it doesn't want to stay around }
  88.  
  89.  
  90. {********************************************************************************************
  91.  
  92.     miscellaneous
  93.  
  94. ********************************************************************************************}
  95.     sdevFileType                = 'sdev';                        {  module's file type }
  96.  
  97.     sdevMenuItemMark            = $A5;                            {  ‘•’: ‘checkmark’ to use in popup menus }
  98.  
  99.  
  100. {     direction values for SBDrawBarGraph }
  101.  
  102.     BarGraphSlopeLeft            = -1;                            {  max end of sloping bar graph is on the left }
  103.     BarGraphFlatRight            = 0;                            {  max end of flat bar graph is on the right }
  104.     BarGraphSlopeRight            = 1;                            {  max end of sloping bar graph is on the right }
  105.  
  106. {********************************************************************************************
  107.  
  108.     utility routines to provide standard interface elements and support for common functions
  109.  
  110. ********************************************************************************************}
  111. FUNCTION SBIsControlStripVisible: BOOLEAN;
  112.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  113.     INLINE $7000, $AAF2;
  114.     {$ENDC}
  115. PROCEDURE SBShowHideControlStrip(showIt: BOOLEAN);
  116.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  117.     INLINE $303C, $0101, $AAF2;
  118.     {$ENDC}
  119. FUNCTION SBSafeToAccessStartupDisk: BOOLEAN;
  120.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  121.     INLINE $7002, $AAF2;
  122.     {$ENDC}
  123. FUNCTION SBOpenModuleResourceFile(fileCreator: OSType): INTEGER;
  124.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  125.     INLINE $303C, $0203, $AAF2;
  126.     {$ENDC}
  127. FUNCTION SBLoadPreferences(prefsResourceName: Str255; VAR preferences: Handle): OSErr;
  128.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  129.     INLINE $303C, $0404, $AAF2;
  130.     {$ENDC}
  131. FUNCTION SBSavePreferences(prefsResourceName: Str255; preferences: Handle): OSErr;
  132.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  133.     INLINE $303C, $0405, $AAF2;
  134.     {$ENDC}
  135. PROCEDURE SBGetDetachedIndString(theString: StringPtr; stringList: Handle; whichString: INTEGER);
  136.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  137.     INLINE $303C, $0506, $AAF2;
  138.     {$ENDC}
  139. FUNCTION SBGetDetachIconSuite(VAR theIconSuite: Handle; theResID: INTEGER; selector: UInt32): OSErr;
  140.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  141.     INLINE $303C, $0507, $AAF2;
  142.     {$ENDC}
  143. FUNCTION SBTrackPopupMenu({CONST}VAR moduleRect: Rect; theMenu: MenuHandle): INTEGER;
  144.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  145.     INLINE $303C, $0408, $AAF2;
  146.     {$ENDC}
  147. FUNCTION SBTrackSlider({CONST}VAR moduleRect: Rect; ticksOnSlider: INTEGER; initialValue: INTEGER): INTEGER;
  148.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  149.     INLINE $303C, $0409, $AAF2;
  150.     {$ENDC}
  151. FUNCTION SBShowHelpString({CONST}VAR moduleRect: Rect; helpString: StringPtr): OSErr;
  152.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  153.     INLINE $303C, $040A, $AAF2;
  154.     {$ENDC}
  155. FUNCTION SBGetBarGraphWidth(barCount: INTEGER): INTEGER;
  156.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  157.     INLINE $303C, $010B, $AAF2;
  158.     {$ENDC}
  159. PROCEDURE SBDrawBarGraph(level: INTEGER; barCount: INTEGER; direction: INTEGER; barGraphTopLeft: Point);
  160.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  161.     INLINE $303C, $050C, $AAF2;
  162.     {$ENDC}
  163. PROCEDURE SBModalDialogInContext(filterProc: ModalFilterUPP; VAR itemHit: INTEGER);
  164.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  165.     INLINE $303C, $040D, $AAF2;
  166.     {$ENDC}
  167. { The following routines are available in Control Strip 1.2 and later. }
  168. FUNCTION SBGetControlStripFontID(VAR fontID: INTEGER): OSErr;
  169.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  170.     INLINE $303C, $020E, $AAF2;
  171.     {$ENDC}
  172. FUNCTION SBSetControlStripFontID(fontID: INTEGER): OSErr;
  173.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  174.     INLINE $303C, $010F, $AAF2;
  175.     {$ENDC}
  176. FUNCTION SBGetControlStripFontSize(VAR fontSize: INTEGER): OSErr;
  177.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  178.     INLINE $303C, $0210, $AAF2;
  179.     {$ENDC}
  180. FUNCTION SBSetControlStripFontSize(fontSize: INTEGER): OSErr;
  181.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  182.     INLINE $303C, $0111, $AAF2;
  183.     {$ENDC}
  184. FUNCTION SBGetShowHideHotKey(VAR modifiers: INTEGER; VAR keyCode: UInt8): OSErr;
  185.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  186.     INLINE $303C, $0412, $AAF2;
  187.     {$ENDC}
  188. FUNCTION SBSetShowHideHotKey(modifiers: INTEGER; keyCode: ByteParameter): OSErr;
  189.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  190.     INLINE $303C, $0213, $AAF2;
  191.     {$ENDC}
  192. FUNCTION SBIsShowHideHotKeyEnabled(VAR enabled: BOOLEAN): OSErr;
  193.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  194.     INLINE $303C, $0214, $AAF2;
  195.     {$ENDC}
  196. FUNCTION SBEnableShowHideHotKey(enabled: BOOLEAN): OSErr;
  197.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  198.     INLINE $303C, $0115, $AAF2;
  199.     {$ENDC}
  200. { The following routines are available in Control Strip 1.4 and later. }
  201. FUNCTION SBHitTrackSlider({CONST}VAR moduleRect: Rect; ticksOnSlider: INTEGER; initialValue: INTEGER; VAR hit: BOOLEAN): INTEGER;
  202.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  203.     INLINE $303C, $0616, $AAF2;
  204.     {$ENDC}
  205.  
  206. {$ALIGN RESET}
  207. {$POP}
  208.  
  209. {$SETC UsingIncludes := ControlStripIncludes}
  210.  
  211. {$ENDC} {__CONTROLSTRIP__}
  212.  
  213. {$IFC NOT UsingIncludes}
  214.  END.
  215. {$ENDC}
  216.